#app {

  .main-container {
    height: 100%;
    transition: margin-left .28s;
    margin-left: $base-sidebar-width;
    position: relative;
    background-color: #f5f7fa;
  }

  .sidebarHide {
    margin-left: 0!important;
  }

  .sidebar-container {
    -webkit-transition: width .28s;
    transition: width 0.28s;
    width: $base-sidebar-width !important;
    background-color: $base-menu-background;
    height: 100%;
    position: fixed;
    font-size: 0px;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1001;
    overflow: hidden;
    box-shadow: 2px 0 6px rgba(0, 21, 41, 0.15);

    &::after {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      height: 100vh;
      background-color: $base-menu-background;
      z-index: -1;
    }

    // reset element-ui css
    .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
    }

    .scrollbar-wrapper {
      overflow-x: hidden !important;
    }

    .el-scrollbar__bar.is-vertical {
      right: 0px;
    }

    .el-scrollbar {
      height: 100%;
    }

    &.has-logo {
      .el-scrollbar {
        height: calc(100% - 50px);
      }
    }

    .is-horizontal {
      display: none;
    }

    a {
      display: inline-block;
      width: 100%;
      overflow: hidden;
    }

    .svg-icon {
      margin-right: 16px;
    }

    .el-menu {
      border: none;
      height: 100%;
      width: 100% !important;
      background-color: $base-menu-background !important;
    }

    // 菜单项通用样式
    .el-menu-item, 
    .el-sub-menu__title {
      color: rgba(255, 255, 255, 0.8) !important;
      background-color: $base-menu-background !important;
      
      &:hover {
        color: #FFFFFF !important;
        background-color: rgba(58, 123, 255, 0.15) !important;
      }
    }

    .el-menu-item.is-active {
      color: #FFFFFF !important;
      background-color: #3A7BFF !important;
    }

    // 子菜单样式
    .el-sub-menu {
      background-color: $base-menu-background !important;
      
      &.is-active > .el-sub-menu__title {
        color: #FFFFFF !important;
      }

      .el-menu {
        background-color: $base-sub-menu-background !important;
      }

      .el-menu-item {
        background-color: $base-sub-menu-background !important;
        
        &:hover {
          color: #FFFFFF !important;
          background-color: rgba(58, 123, 255, 0.15) !important;
        }
        
        &.is-active {
          color: #FFFFFF !important;
          background-color: #3A7BFF !important;
        }
      }
    }
  }

  .hideSidebar {
    .sidebar-container {
      width: 54px !important;
    }

    .main-container {
      margin-left: 54px;
    }

    .el-menu-item {
      .el-tooltip__trigger {
        display: flex !important;
        justify-content: center;
        align-items: center;
        padding: 0 !important;
        
        .svg-icon {
          margin: 0 !important;
        }
      }
    }

    .sub-menu-title-noDropdown {
      padding: 0 !important;
      position: relative;

      .el-tooltip {
        padding: 0 !important;

        .svg-icon {
          margin: 0;
        }
      }
    }

    .el-sub-menu {
      overflow: hidden;

      &>.el-sub-menu__title {
        padding: 0 !important;

        .svg-icon {
          margin-left: 20px;
          margin-right: 0;
          visibility: visible !important;
        }
      }
    }

    .el-menu--collapse {
      .el-sub-menu {
        &>.el-sub-menu__title {
          &>span {
            height: 0;
            width: 0;
            overflow: hidden;
            visibility: hidden;
            display: inline-block;
          }
          .svg-icon {
            margin-left: 20px !important;
            margin-right: 0 !important;
            visibility: visible !important;
          }
        }
      }
    }
  }

  .el-menu--collapse .el-menu .el-sub-menu {
    min-width: $base-sidebar-width !important;
  }

  // mobile responsive
  .mobile {
    .main-container {
      margin-left: 0px;
    }

    .sidebar-container {
      transition: transform .28s;
      width: $base-sidebar-width !important;
    }

    &.hideSidebar {
      .sidebar-container {
        pointer-events: none;
        transition-duration: 0.3s;
        transform: translate3d(-$base-sidebar-width, 0, 0);
      }
    }
  }

  .withoutAnimation {

    .main-container,
    .sidebar-container {
      transition: none;
    }
  }
}

// when menu collapsed
.el-menu--vertical {
  & > .el-menu {
    .svg-icon {
      margin-right: 16px;
    }
  }

  .nest-menu .el-sub-menu > .el-sub-menu__title,
  .el-menu-item {
    &:hover {
      color: #FFFFFF !important;
      background-color: rgba(58, 123, 255, 0.15) !important;
    }
  }

  > .el-menu--popup {
    max-height: 100vh;
    overflow-y: auto;
    background-color: $base-menu-background !important;

    &::-webkit-scrollbar-track-piece {
      background: rgba(0, 0, 0, 0.1);
    }

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.2);
      border-radius: 20px;
    }
  }
}
